package com.jade.zsy.base.entity;

import com.jade.bss.db.IdEntity;
import lombok.Data;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

/**
 * 商品管理
 * User: jinya
 * Date: 2017/5/24
 * Time: 15:41
 * TEL :17701640710   MAIL:2009_jinya@163.com
 * To change this template use File | Settings | File Templates.
 */
@Data
@Entity
@Table(name = "SCF_BASE_SKU")
public class Sku  extends IdEntity {
    /**
     * 商品主要图片
     */
    @Column(name = "mainPhoto", nullable = true,updatable = true)
    private String mainPhoto;
    @Column(name = "barcode", nullable = true,updatable = true)
    private String barcode;  // barcode
    @Column(name = "sku_code", nullable = true,updatable = true)
    private String skuCode;  // skuCode
    @Column(name = "skuSpec", nullable = true,updatable = true)
    private String skuSpec;  // 规格
    @Column(name = "skuName", nullable = true,updatable = true,length = 100)
    private String skuName; // 商品名称
    @Column(name = "produce", nullable = true,updatable = true,length = 100)
    private String produce; // 产地
    @Column(name = "barnd", nullable = true,updatable = true,length = 100)
    private String barnd ; // 品牌
    @Column(name = "costPrice",precision = 12, scale = 2)
    private double costPrice;// 成本价格
    @Column(name = "price",precision = 12, scale = 2)
    private double price;// 吊牌价格
    @Column(columnDefinition = "int default 0",name = "inventory", nullable = true,updatable = true)
    private long inventory=0;// 库存预警
    @Column(name = "weight",precision = 12, scale = 2)
    private BigDecimal weight=new BigDecimal(0);// 重量
    @Column(name = "volume",precision = 12, scale = 2)
    private BigDecimal volume=new BigDecimal(0);//体积
    @Column(columnDefinition = "LongText",name = "details", nullable = true,updatable = true)
    private String details;
    @Column(columnDefinition = "int default 0",name = "status", nullable = true,updatable = true)
    private int status;
    @OneToOne(optional = true, cascade = CascadeType.REFRESH)
    @JoinColumn(name="main_photo_id")
    private Accessory main_photo;
    @Column(name = "photos", nullable = true,updatable = true)//多图片，用逗号分隔
    private String photosId;
    @Transient //这里配置关系，并且确定关系维护端和被维护端。mappBy表示关系被维护端，
    private List<Accessory> photos = new ArrayList();
    /**
     * SEO关键字
     */
    @Column(name = "seo", length = 100)
    private String seo;
    @Column(name = "unitId", nullable = false,updatable = true)
    private long unitId=0;/**商品计量单位*/
    @Column(name = "unit", nullable = false,updatable = true)
    private String unit;/**商品计量单位*/

    @Column(name = "skuSpecId01", nullable = false,updatable = true)
    private long skuSpecId01=0;/**商品属性*/
    @Column(name = "skuSpecId02", nullable = false,updatable = true)
    private long skuSpecId02;/**商品属性*/
    @Column(name = "skuSpecId03", nullable = false,updatable = true)
    private long skuSpecId03;/**商品属性*/
    @Column(name = "skuSpecId04", nullable = false,updatable = true)
    private long skuSpecId04;/**商品属性*/
    @Column(name = "skuSpecId05", nullable = false,updatable = true)
    private long skuSpecId05;/**商品属性*/
    @Column(name = "skuSpecId06", nullable = false,updatable = true)
    private long skuSpecId06;/**商品属性*/
    @Column(name = "skuSpecId07", nullable = false,updatable = true)
    private long skuSpecId07;/**商品属性*/
    @Column(name = "skuSpecId08", nullable = false,updatable = true)
    private long skuSpecId08;/**商品属性*/
    @Column(name = "skuSpecId09", nullable = false,updatable = true)
    private long skuSpecId09;/**商品属性*/
    @Column(name = "skuSpecId10", nullable = false,updatable = true)
    private long skuSpecId10;/**商品属性*/

    @Column(name = "userDef01", nullable = true,updatable = true)
    private String userDef01;/**用户自定义*/
    @Column(name = "userDef02", nullable = true,updatable = true)
    private String userDef02;/**用户自定义*/
    @Column(name = "userDef03", nullable = true,updatable = true)
    private String userDef03;/**用户自定义*/
    @Column(name = "userDef04", nullable = true,updatable = true)
    private String userDef04;/**用户自定义*/
    @Column(name = "userDef05", nullable = true,updatable = true)
    private String userDef05;/**用户自定义*/
    @Column(name = "userDef06", nullable = true,updatable = true)
    private String userDef06;/**用户自定义*/
    @Column(name = "userDef07", nullable = true,updatable = true)
    private String userDef07;/**用户自定义*/
    @Column(name = "userDef08", nullable = true,updatable = true)
    private String userDef08;/**用户自定义*/
    @Column(name = "userDef09", nullable = true,updatable = true)
    private String userDef09;/**用户自定义*/
    @Column(name = "userDef10", nullable = true,updatable = true)
    private String userDef10;/**用户自定义*/

    public BigDecimal getWeight() {
        return weight;
    }

    public void setWeight(BigDecimal weight) {
        this.weight = weight;
    }

    public String getMainPhoto() {
        return mainPhoto;
    }

    public void setMainPhoto(String mainPhoto) {
        this.mainPhoto = mainPhoto;
    }

    public String getBarcode() {
        return barcode;
    }

    public void setBarcode(String barcode) {
        this.barcode = barcode;
    }

    public String getSkuCode() {
        return skuCode;
    }

    public void setSkuCode(String skuCode) {
        this.skuCode = skuCode;
    }

    public String getSkuName() {
        return skuName;
    }

    public void setSkuName(String skuName) {
        this.skuName = skuName;
    }

    public double getCostPrice() {
        return costPrice;
    }

    public void setCostPrice(double costPrice) {
        this.costPrice = costPrice;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public long getInventory() {
        return inventory;
    }

    public void setInventory(long inventory) {
        this.inventory = inventory;
    }

    public BigDecimal getVolume() {
        return volume;
    }

    public void setVolume(BigDecimal volume) {
        this.volume = volume;
    }

    public String getDetails() {
        return details;
    }

    public void setDetails(String details) {
        this.details = details;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public Accessory getMain_photo() {
        return main_photo;
    }

    public void setMain_photo(Accessory main_photo) {
        this.main_photo = main_photo;
    }

    public String getPhotosId() {
        return photosId;
    }

    public void setPhotosId(String photosId) {
        this.photosId = photosId;
    }

    public List<Accessory> getPhotos() {
        return photos;
    }

    public void setPhotos(List<Accessory> photos) {
        this.photos = photos;
    }

    public String getSeo() {
        return seo;
    }

    public void setSeo(String seo) {
        this.seo = seo;
    }

    public long getUnitId() {
        return unitId;
    }

    public void setUnitId(long unitId) {
        this.unitId = unitId;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    public String getSkuSpec() {
        return skuSpec;
    }

    public void setSkuSpec(String skuSpec) {
        this.skuSpec = skuSpec;
    }

    public long getSkuSpecId01() {
        return skuSpecId01;
    }

    public void setSkuSpecId01(long skuSpecId01) {
        this.skuSpecId01 = skuSpecId01;
    }

    public long getSkuSpecId02() {
        return skuSpecId02;
    }

    public void setSkuSpecId02(long skuSpecId02) {
        this.skuSpecId02 = skuSpecId02;
    }

    public long getSkuSpecId03() {
        return skuSpecId03;
    }

    public void setSkuSpecId03(long skuSpecId03) {
        this.skuSpecId03 = skuSpecId03;
    }

    public long getSkuSpecId04() {
        return skuSpecId04;
    }

    public void setSkuSpecId04(long skuSpecId04) {
        this.skuSpecId04 = skuSpecId04;
    }

    public long getSkuSpecId05() {
        return skuSpecId05;
    }

    public void setSkuSpecId05(long skuSpecId05) {
        this.skuSpecId05 = skuSpecId05;
    }

    public long getSkuSpecId06() {
        return skuSpecId06;
    }

    public void setSkuSpecId06(long skuSpecId06) {
        this.skuSpecId06 = skuSpecId06;
    }

    public long getSkuSpecId07() {
        return skuSpecId07;
    }

    public void setSkuSpecId07(long skuSpecId07) {
        this.skuSpecId07 = skuSpecId07;
    }

    public long getSkuSpecId08() {
        return skuSpecId08;
    }

    public void setSkuSpecId08(long skuSpecId08) {
        this.skuSpecId08 = skuSpecId08;
    }

    public long getSkuSpecId09() {
        return skuSpecId09;
    }

    public void setSkuSpecId09(long skuSpecId09) {
        this.skuSpecId09 = skuSpecId09;
    }

    public long getSkuSpecId10() {
        return skuSpecId10;
    }

    public void setSkuSpecId10(long skuSpecId10) {
        this.skuSpecId10 = skuSpecId10;
    }

    public String getUserDef01() {
        return userDef01;
    }

    public void setUserDef01(String userDef01) {
        this.userDef01 = userDef01;
    }

    public String getUserDef02() {
        return userDef02;
    }

    public void setUserDef02(String userDef02) {
        this.userDef02 = userDef02;
    }

    public String getUserDef03() {
        return userDef03;
    }

    public void setUserDef03(String userDef03) {
        this.userDef03 = userDef03;
    }

    public String getUserDef04() {
        return userDef04;
    }

    public void setUserDef04(String userDef04) {
        this.userDef04 = userDef04;
    }

    public String getUserDef05() {
        return userDef05;
    }

    public void setUserDef05(String userDef05) {
        this.userDef05 = userDef05;
    }

    public String getUserDef06() {
        return userDef06;
    }

    public void setUserDef06(String userDef06) {
        this.userDef06 = userDef06;
    }

    public String getUserDef07() {
        return userDef07;
    }

    public void setUserDef07(String userDef07) {
        this.userDef07 = userDef07;
    }

    public String getUserDef08() {
        return userDef08;
    }

    public void setUserDef08(String userDef08) {
        this.userDef08 = userDef08;
    }

    public String getUserDef09() {
        return userDef09;
    }

    public void setUserDef09(String userDef09) {
        this.userDef09 = userDef09;
    }

    public String getUserDef10() {
        return userDef10;
    }

    public void setUserDef10(String userDef10) {
        this.userDef10 = userDef10;
    }

    public String getProduce() {
        return produce;
    }

    public void setProduce(String produce) {
        this.produce = produce;
    }

    public String getBarnd() {
        return barnd;
    }

    public void setBarnd(String barnd) {
        this.barnd = barnd;
    }
}